Crate bevy_audio
source ·Expand description
Audio support for the game engine Bevy
fn main() {
App::new()
.add_plugins(MinimalPlugins)
.add_plugin(AssetPlugin::default())
.add_plugin(AudioPlugin)
.add_startup_system(play_background_audio)
.run();
}
fn play_background_audio(asset_server: Res<AssetServer>, audio: Res<Audio>) {
audio.play(asset_server.load("background_audio.ogg"));
}
Modules
Structs
Loads files as
AudioSource
Assets
Used internally to play audio on the current “audio device”
Adds support for audio playback to a Bevy Application
Asset controlling the playback of a sound
A source of audio data
Settings to control playback from the start.
Traits
Trait for containers that contain PCM data.
A type implementing this trait can be decoded as a rodio source
Represents a value of a single sample.
A source of samples.
Functions
Plays audio currently queued in the
Audio
resource through the AudioOutput
resource